﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LardonPokerSimulator.Model.Logging
{
    public class Log
    {
        private static List<Log> __logList = new List<Log>();

        private String _message = string.Empty;
        private DateTime _dateTime = DateTime.Now;

        private Log(String aMessage)
        {
            this._message = aMessage;
        }

        public override string ToString()
        {
 	         return String.Format("{0} : {1}",this._dateTime.ToString("mm/dd/yyyy hh:MM:ss"),this._message);
        }

        public static void AddLog(String aMessage)
        {
            Log l = new Log(aMessage);
            Log.__logList.Add(l);
        }

        public static void Write(TextWriter aTextWriter)
        {
            foreach (Log l in Log.__logList)
            {
                aTextWriter.WriteLine(l);
            }
        }

    }
}
